package com.youhome.service.impl;

import com.youhome.mapper.HouseFavouriteMapper;
import com.youhome.model.HouseFavourite;
import com.youhome.service.HouseFavouriteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * Created by chen365 on 2018/06/27.
 */
@Service
public class HouseFavouriteServiceImpl implements HouseFavouriteService {
    @Autowired
    private HouseFavouriteMapper houseFavouriteMapper;

    @Override
    public int deleteByPrimaryKey(Long id) {
        return houseFavouriteMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insertSelective(HouseFavourite record) {
        record.setCreateTime(new Date());
        return houseFavouriteMapper.insertSelective(record);
    }

    @Override
    public HouseFavourite selectByUserIdAndHouseId(HouseFavourite record) {
        return houseFavouriteMapper.selectByUserIdAndHouseId(record);
    }

    @Override
    public List<String> selectHouseIdByUserId(Long userId) {
        return houseFavouriteMapper.selectHouseIdByUserId(userId);
    }
}
